package com.lingo.mgr.enums;

/**
 * @author PC
 */

public enum ChatGptTokensEunm {



    GPT_3_5_TURBO_0301("gpt-3.5-turbo-0301",4096),
    GPT_3_5_TURBO_0613("gpt-3.5-turbo-0613",4096),
    GPT_3_5_TURBO_16K("gpt-3.5-turbo-16k",16384),
    GPT_3_5_TURBO_16K_0613("gpt-3.5-turbo-16k-0613",16384),
    GPT_3_5_TURBO("gpt-3.5-turbo",4096),
    /** @deprecated */
    GPT_4("gpt-4",4096),
    /** @deprecated */
    @Deprecated
    GPT_4_0314("gpt-4-0314",4096),
    GPT_4_32K("gpt-4-32k",32768),
    GPT_4_32K_0314("gpt-4-32k-0314",32768),
    GPT_4_0613("gpt-4-0613",4096),
    GPT_4_32K_0613("gpt-4-32k-0613",32768);
    ;

    private final Integer length;
    private final String name;

    ChatGptTokensEunm(String name, Integer length) {
        this.length = length;
        this.name = name;
    }

    public Integer getLength() {
        return length;
    }

    public String getName() {
        return name;
    }

    public static ChatGptTokensEunm getLengthByName(String name) {
        for (ChatGptTokensEunm value : values()) {
            if (value.getName().equals(name)) {
                return value;
            }
        }
        return null;
    }
}
